import axios from '@/common/plugins/Axios'

export default {
    // 查询场景列表，可分页查询
    querySceneByMul: (stageName: String, useDept: String, statusCd: number, size: number, page: number) => {
        return axios.request({
            url: `/sceneManage/getListScene`,
            method: 'get',
            params: {
                stageName: stageName,
                useDept: useDept,
                statusCd: statusCd,
                size: size,
                page: page
            }
        })
    },

    // 场景注册
    registerScene: (scene) => {
        return axios.request({
            url: `/sceneManage/registerScene`,
            method: 'put',
            data: scene
        })
    },
    // 场景更改
    updateScene: (scene) => {
        return axios.request({
            url: `/sceneManage/updateScene`,
            method: 'post',
            data: scene
        })
    },
    // 场景注销
    deleteScene: (stageId: String) => {
        return axios.request({
            url: `/sceneManage/scenesOffline`,
            method: 'post',
            data: { stageId }
        })
    },
    // 场景授权保存
    saveScene: (stageId, userIds, orgIds) => {
        return axios.request({
            url: `/sceneManage/sceneMaintenance/saveSence`,
            method: 'put',
            data: {
                stageId: stageId,
                userIds: userIds,
                orgIds: orgIds
            }
        })
    },
    // 场景开发绑定
    sceneBinding: (stageId, staffAccount, staffName, mobilePhone) => {
        return axios.request({
            url: `/sceneManage/sceneBinding`,
            method: 'put',
            data: {
                stageId: stageId,
                staffAccount: staffAccount,
                staffName: staffName,
                mobilePhone: mobilePhone
            }
        })
    },
    // 场景授权弹窗查询列表（人员）
    querySceneAuthList: () => {
        return axios.request({
            url: `/sceneManage/sceneMaintenance/getSceneAuthList`,
            method: 'get',
        })
    },
    // 场景授权弹窗查询列表（组织）
    querySceneAuthOrgList: (orgId: String) => {
        return axios.request({
            url: `/sceneManage/sceneMaintenance/getSceneAuthOrgList`,
            method: 'get',
            params: {orgId}
        })
    },
    // 场景已授权弹窗查询列表
    querySceneSaveList: (stageId: String) => {
        return axios.request({
            url: `/sceneManage/sceneMaintenance/getSceneSaveList`,
            method: 'get',
            params: {stageId}
        })
    },


    // 场景授权查询列表（人员）
    querySceneStaff: (stageName: String, size: number, page: number) => {
        return axios.request({
            url: `/sceneManage/sceneMaintenance/getScenesByStaff`,
            method: 'get',
            params: {
                stageName: stageName,
                size: size,
                page: page
            }
        })
    },
    // 场景授权查询列表（组织）
    querySceneOrg: (stageName: String, size: number, page: number) => {
        return axios.request({
            url: `/sceneManage/sceneMaintenance/getScenecesByOrg`,
            method: 'get',
            params: {
                stageName: stageName,
                size: size,
                page: page
            }
        })
    },
    // 场景授权弹窗查询列表(组织搜索框)
    querySceneAuthOrgListSelect: (orgName: String) => {
        return axios.request({
            url: `/sceneManage/sceneMaintenance/getSceneAuthOrgListSelect`,
            method: 'get',
            params: {
                orgName: orgName
            }
        })
    },
}
